//
//  PushZX.m
//  HYHoney
//
//  Created by dllo on 16/2/26.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "PushZX.h"
#import "ModelForZX.h"
#import "UIImageView+WebCache.h"
#import "CellForImg.h"
#import "DKNightVersion.h"

@interface PushZX ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, retain)NSMutableArray *arr;
@property (nonatomic, retain)UIImageView *imageZX;
@property (nonatomic, retain)UITableView *tableView;

@end

@implementation PushZX


- (void)dealloc{

    [_arr release];
    [_imageZX release];
    [_tableView release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
   
    [self createTableView];
    
}


- (void)createTableView{
    
    self.tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
    
    [self.view addSubview:self.tableView];
    [self.tableView release];
    
    [self.tableView registerClass:[CellForImg class] forCellReuseIdentifier:@"pool"];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.dk_backgroundColorPicker = DKColorWithRGB(0xFFFAFA, 0x27408B);
    self.tableView.showsVerticalScrollIndicator = NO;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    CellForImg *cell = [tableView dequeueReusableCellWithIdentifier:@"pool"];
    [cell passModelZX:self.model];
    
    return cell;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return [CellForImg heightForCellZX:self.model];
    
}


- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:animated];
}


- (void)viewWillDisappear:(BOOL)animated{
    
    [super viewWillDisappear:animated];
}

//- (void)passModelZX:(ModelForZX *)model{
//
//    self.model = model;
//    
//    self.imageZX = [[UIImageView alloc] init];
//    [self.view addSubview:self.imageZX];
//    
//    self.width = model.width;
//    self.height = model.height;
//    self.url = model.thumbnail;
//    
//    self.imageZX.frame = CGRectMake((self.view.frame.size.width - 300) / 2, 100, 300, [self.height floatValue] / [self.width floatValue] * 300);
//    [self.imageZX sd_setImageWithURL:[NSURL URLWithString:self.url] placeholderImage:[UIImage imageNamed:@"jzz"]];
//
//}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
